package com.xiaoxu.rental.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.xiaoxu.rental.entity.AutoMaker;
import com.xiaoxu.rental.mapper.AutoMakerMapper;
import com.xiaoxu.rental.service.AutoMakerService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
* @author xtq
* @description 针对表【auto_maker】的数据库操作Service实现
* @createDate 2024-07-26 08:47:27
*/
@Service
@Transactional
public class AutoMakerServiceImpl extends ServiceImpl<AutoMakerMapper, AutoMaker>
    implements AutoMakerService {

    @Override
    public Page<AutoMaker> search(int start, int size, AutoMaker autoMaker)
    {
        QueryWrapper<AutoMaker> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByAsc("order_letter")
                .like(StrUtil.isNotEmpty(autoMaker.getName()), "name",
                        autoMaker.getName());
        Page<AutoMaker> page= new Page<>(start, size);
        this.page(page, queryWrapper);
        return page;
    }

}




